using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Exercise.Api.ParamModel
{
    public class Pager
    {
        //当前页码(当前第几页)
        // [Required]
        public int PagerIndex{get;set;}
        
        //当前页大小(每页几条)
        // [Required]
        public int PagerSize{get;set;}
        //总条数
        public int RowsTotal{get;set;}

        // public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        // {
        //     if(PageIndex<=0){
        //         yield return new ValidationResult(errorMessage:"pageIndex必须大于等于1",new[] {nameof(PageIndex)});
        //     }
        //     if(PageSize<=0){
        //         yield return new ValidationResult(errorMessage:"PageSize必须大于等于1",new[] {nameof(PageSize)});
        //     }
        // }
    }
}